<!-- templates/bootstrap5/admin/suggestions.html -->
{% extends "bootstrap5/admin/base.html" %}
{% block title %}导航网站 - 建议管理{% endblock %}

{% block content %}
<h1 class="mb-4">网站建议管理</h1>

<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>ID</th>
                <th>推荐网站</th>
                <th>推荐语</th>
                <th>邮箱</th>
                <th>IP地址</th>
                <th>时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for suggestion in suggestions %}
            <tr>
                <td>{{ suggestion.id }}</td>
                <td>{{ suggestion.site_name }}</td>
                <td>{{ suggestion.description|truncate(30) }}</td>
                <td>{{ suggestion.email if suggestion.email else '-' }}</td>
                <td>{{ suggestion.ip }}</td>
                <td>{{ suggestion.created_at }}</td>
                <td>
                    {% if suggestion.handled %}
                    <span class="badge bg-success">已处理</span>
                    {% else %}
                    <span class="badge bg-warning text-dark">待处理</span>
                    {% endif %}
                </td>
                <td>
                    {% if not suggestion.handled %}
                    <a href="{{ url_for('admin.handle_suggestion', id=suggestion.id) }}" class="btn btn-sm btn-success">处理</a>
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}